import { sessiconCache } from '@/utils/storageCache'

export default {
  namespaced: true,
  state: {
    // 主题色
    themeColor: sessiconCache.get('wft-gen-theme-color') || '#086d6d',
    // 背景色
    themeBackgroundColor: sessiconCache.get('wft-gen-theme-background') || '#f0f0f0'
  },
  mutations: {
    updatethemeColor(state, themeColor) {
      state.themeColor = themeColor
      sessiconCache.set('wft-gen-theme-color', themeColor)
    },
    updatethemeBackgroundColor(state, themeBackgroundColor) {
      state.themeBackgroundColor = themeBackgroundColor
      sessiconCache.set('wft-gen-theme-background', themeBackgroundColor)
    }
  }
}
